// 日期格式转换成 yyyy-MM-dd
const resetDate = (time) => {
  if (time === null || time === '' || time === undefined) {
    let nData = ''
    return nData
  } else if (time.toString().indexOf('-') === -1) {
    let seperator1 = '-'
    let month = time.getMonth() + 1
    let strDate = time.getDate()
    if (month < 10) {
      month = '0' + month
    }
    if (strDate < 10) {
      strDate = '0' + strDate
    }
    let currentdate = time.getFullYear() + seperator1 + month + seperator1 + strDate
    return currentdate
  } else {
    return time
  }
}
export default resetDate
